package com.mocha;

import lombok.Getter;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;

/**
 * @author songkui
 * @since 2024/3/26 10:27
 */

public class ClientManager {

    private ClientManager(){}
    private static final class ProcessorManagerHolder {
        static final ClientManager processorManager = new ClientManager();
    }

    public static ClientManager getInstance(){
        return ProcessorManagerHolder.processorManager;
    }

    //key userId;
    @Getter
    private final ConcurrentHashMap<String, SocketClient> clientMap = new ConcurrentHashMap<>();

    public void put(SocketClient client){
        clientMap.put(client.getUserId(), client);
    }


}
